$OpenBSD: patch-xdata_xsddefault_c,v 1.1 2015/01/19 16:59:42 sthen Exp $
--- xdata/xsddefault.c.orig	Mon Jan 19 16:43:19 2015
+++ xdata/xsddefault.c	Mon Jan 19 16:49:42 2015
@@ -363,7 +363,7 @@ int xsddefault_save_status_data(void) {
 
 	/* write file info */
 	fprintf(fp, "info {\n");
-	fprintf(fp, "\tcreated=%lu\n", current_time);
+	fprintf(fp, "\tcreated=%llu\n", (long long)current_time);
 	fprintf(fp, "\tversion=%s\n", PROGRAM_VERSION);
 	fprintf(fp, "\t}\n\n");
 
@@ -373,11 +373,11 @@ int xsddefault_save_status_data(void) {
 	fprintf(fp, "\tmodified_service_attributes=%lu\n", modified_service_process_attributes);
 	fprintf(fp, "\ticinga_pid=%d\n", nagios_pid);
 	fprintf(fp, "\tdaemon_mode=%d\n", daemon_mode);
-	fprintf(fp, "\tprogram_start=%lu\n", program_start);
-	fprintf(fp, "\tlast_command_check=%lu\n", last_command_check);
-	fprintf(fp, "\tlast_log_rotation=%lu\n", last_log_rotation);
+	fprintf(fp, "\tprogram_start=%llu\n", (long long)program_start);
+	fprintf(fp, "\tlast_command_check=%llu\n", (long long)last_command_check);
+	fprintf(fp, "\tlast_log_rotation=%llu\n", (long long)last_log_rotation);
 	fprintf(fp, "\tenable_notifications=%d\n", enable_notifications);
-	fprintf(fp, "\tdisable_notifications_expire_time=%lu\n", disable_notifications_expire_time);
+	fprintf(fp, "\tdisable_notifications_expire_time=%llu\n", (long long)disable_notifications_expire_time);
 	fprintf(fp, "\tactive_service_checks_enabled=%d\n", execute_service_checks);
 	fprintf(fp, "\tpassive_service_checks_enabled=%d\n", accept_passive_service_checks);
 	fprintf(fp, "\tactive_host_checks_enabled=%d\n", execute_host_checks);
@@ -444,19 +444,19 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\tplugin_output=%s\n", (temp_host->plugin_output == NULL) ? "" : temp_host->plugin_output);
 		fprintf(fp, "\tlong_plugin_output=%s\n", (temp_host->long_plugin_output == NULL) ? "" : temp_host->long_plugin_output);
 		fprintf(fp, "\tperformance_data=%s\n", (temp_host->perf_data == NULL) ? "" : temp_host->perf_data);
-		fprintf(fp, "\tlast_check=%lu\n", temp_host->last_check);
-		fprintf(fp, "\tnext_check=%lu\n", temp_host->next_check);
+		fprintf(fp, "\tlast_check=%llu\n", (long long)temp_host->last_check);
+		fprintf(fp, "\tnext_check=%llu\n", (long long)temp_host->next_check);
 		fprintf(fp, "\tcheck_options=%d\n", temp_host->check_options);
 		fprintf(fp, "\tcurrent_attempt=%d\n", temp_host->current_attempt);
 		fprintf(fp, "\tmax_attempts=%d\n", temp_host->max_attempts);
 		fprintf(fp, "\tstate_type=%d\n", temp_host->state_type);
-		fprintf(fp, "\tlast_state_change=%lu\n", temp_host->last_state_change);
-		fprintf(fp, "\tlast_hard_state_change=%lu\n", temp_host->last_hard_state_change);
-		fprintf(fp, "\tlast_time_up=%lu\n", temp_host->last_time_up);
-		fprintf(fp, "\tlast_time_down=%lu\n", temp_host->last_time_down);
-		fprintf(fp, "\tlast_time_unreachable=%lu\n", temp_host->last_time_unreachable);
-		fprintf(fp, "\tlast_notification=%lu\n", temp_host->last_host_notification);
-		fprintf(fp, "\tnext_notification=%lu\n", temp_host->next_host_notification);
+		fprintf(fp, "\tlast_state_change=%llu\n", (long long)temp_host->last_state_change);
+		fprintf(fp, "\tlast_hard_state_change=%llu\n", (long long)temp_host->last_hard_state_change);
+		fprintf(fp, "\tlast_time_up=%llu\n", (long long)temp_host->last_time_up);
+		fprintf(fp, "\tlast_time_down=%llu\n", (long long)temp_host->last_time_down);
+		fprintf(fp, "\tlast_time_unreachable=%llu\n", (long long)temp_host->last_time_unreachable);
+		fprintf(fp, "\tlast_notification=%llu\n", (long long)temp_host->last_host_notification);
+		fprintf(fp, "\tnext_notification=%llu\n", (long long)temp_host->next_host_notification);
 		fprintf(fp, "\tno_more_notifications=%d\n", temp_host->no_more_notifications);
 		fprintf(fp, "\tcurrent_notification_number=%d\n", temp_host->current_notification_number);
 		/* state based escalation ranges */
@@ -467,7 +467,7 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\tnotifications_enabled=%d\n", temp_host->notifications_enabled);
 		fprintf(fp, "\tproblem_has_been_acknowledged=%d\n", temp_host->problem_has_been_acknowledged);
 		fprintf(fp, "\tacknowledgement_type=%d\n", temp_host->acknowledgement_type);
-		fprintf(fp, "\tacknowledgement_end_time=%lu\n", temp_host->acknowledgement_end_time);
+		fprintf(fp, "\tacknowledgement_end_time=%llu\n", (long long)temp_host->acknowledgement_end_time);
 		fprintf(fp, "\tactive_checks_enabled=%d\n", temp_host->checks_enabled);
 		fprintf(fp, "\tpassive_checks_enabled=%d\n", temp_host->accept_passive_host_checks);
 		fprintf(fp, "\tevent_handler_enabled=%d\n", temp_host->event_handler_enabled);
@@ -475,7 +475,7 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\tfailure_prediction_enabled=%d\n", temp_host->failure_prediction_enabled);
 		fprintf(fp, "\tprocess_performance_data=%d\n", temp_host->process_performance_data);
 		fprintf(fp, "\tobsess_over_host=%d\n", temp_host->obsess_over_host);
-		fprintf(fp, "\tlast_update=%lu\n", current_time);
+		fprintf(fp, "\tlast_update=%llu\n", (long long)current_time);
 		fprintf(fp, "\tis_flapping=%d\n", temp_host->is_flapping);
 		fprintf(fp, "\tpercent_state_change=%.2f\n", temp_host->percent_state_change);
 		fprintf(fp, "\tscheduled_downtime_depth=%d\n", temp_host->scheduled_downtime_depth);
@@ -522,17 +522,17 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\tcurrent_attempt=%d\n", temp_service->current_attempt);
 		fprintf(fp, "\tmax_attempts=%d\n", temp_service->max_attempts);
 		fprintf(fp, "\tstate_type=%d\n", temp_service->state_type);
-		fprintf(fp, "\tlast_state_change=%lu\n", temp_service->last_state_change);
-		fprintf(fp, "\tlast_hard_state_change=%lu\n", temp_service->last_hard_state_change);
-		fprintf(fp, "\tlast_time_ok=%lu\n", temp_service->last_time_ok);
-		fprintf(fp, "\tlast_time_warning=%lu\n", temp_service->last_time_warning);
-		fprintf(fp, "\tlast_time_unknown=%lu\n", temp_service->last_time_unknown);
-		fprintf(fp, "\tlast_time_critical=%lu\n", temp_service->last_time_critical);
+		fprintf(fp, "\tlast_state_change=%llu\n", (long long)temp_service->last_state_change);
+		fprintf(fp, "\tlast_hard_state_change=%llu\n", (long long)temp_service->last_hard_state_change);
+		fprintf(fp, "\tlast_time_ok=%llu\n", (long long)temp_service->last_time_ok);
+		fprintf(fp, "\tlast_time_warning=%llu\n", (long long)temp_service->last_time_warning);
+		fprintf(fp, "\tlast_time_unknown=%llu\n", (long long)temp_service->last_time_unknown);
+		fprintf(fp, "\tlast_time_critical=%llu\n", (long long)temp_service->last_time_critical);
 		fprintf(fp, "\tplugin_output=%s\n", (temp_service->plugin_output == NULL) ? "" : temp_service->plugin_output);
 		fprintf(fp, "\tlong_plugin_output=%s\n", (temp_service->long_plugin_output == NULL) ? "" : temp_service->long_plugin_output);
 		fprintf(fp, "\tperformance_data=%s\n", (temp_service->perf_data == NULL) ? "" : temp_service->perf_data);
-		fprintf(fp, "\tlast_check=%lu\n", temp_service->last_check);
-		fprintf(fp, "\tnext_check=%lu\n", temp_service->next_check);
+		fprintf(fp, "\tlast_check=%llu\n", (long long)temp_service->last_check);
+		fprintf(fp, "\tnext_check=%llu\n", (long long)temp_service->next_check);
 		fprintf(fp, "\tcheck_options=%d\n", temp_service->check_options);
 		fprintf(fp, "\tcurrent_notification_number=%d\n", temp_service->current_notification_number);
 		/* state based escalation ranges */
@@ -541,8 +541,8 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\tcurrent_unknown_notification_number=%d\n", temp_service->current_unknown_notification_number);
 
 		fprintf(fp, "\tcurrent_notification_id=%lu\n", temp_service->current_notification_id);
-		fprintf(fp, "\tlast_notification=%lu\n", temp_service->last_notification);
-		fprintf(fp, "\tnext_notification=%lu\n", temp_service->next_notification);
+		fprintf(fp, "\tlast_notification=%llu\n", (long long)temp_service->last_notification);
+		fprintf(fp, "\tnext_notification=%llu\n", (long long)temp_service->next_notification);
 		fprintf(fp, "\tno_more_notifications=%d\n", temp_service->no_more_notifications);
 		fprintf(fp, "\tnotifications_enabled=%d\n", temp_service->notifications_enabled);
 		fprintf(fp, "\tactive_checks_enabled=%d\n", temp_service->checks_enabled);
@@ -550,12 +550,12 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\tevent_handler_enabled=%d\n", temp_service->event_handler_enabled);
 		fprintf(fp, "\tproblem_has_been_acknowledged=%d\n", temp_service->problem_has_been_acknowledged);
 		fprintf(fp, "\tacknowledgement_type=%d\n", temp_service->acknowledgement_type);
-		fprintf(fp, "\tacknowledgement_end_time=%lu\n", temp_service->acknowledgement_end_time);
+		fprintf(fp, "\tacknowledgement_end_time=%llu\n", (long long)temp_service->acknowledgement_end_time);
 		fprintf(fp, "\tflap_detection_enabled=%d\n", temp_service->flap_detection_enabled);
 		fprintf(fp, "\tfailure_prediction_enabled=%d\n", temp_service->failure_prediction_enabled);
 		fprintf(fp, "\tprocess_performance_data=%d\n", temp_service->process_performance_data);
 		fprintf(fp, "\tobsess_over_service=%d\n", temp_service->obsess_over_service);
-		fprintf(fp, "\tlast_update=%lu\n", current_time);
+		fprintf(fp, "\tlast_update=%llu\n", (long long)current_time);
 		fprintf(fp, "\tis_flapping=%d\n", temp_service->is_flapping);
 		fprintf(fp, "\tpercent_state_change=%.2f\n", temp_service->percent_state_change);
 		fprintf(fp, "\tscheduled_downtime_depth=%d\n", temp_service->scheduled_downtime_depth);
@@ -585,8 +585,8 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\thost_notification_period=%s\n", (temp_contact->host_notification_period == NULL) ? "" : temp_contact->host_notification_period);
 		fprintf(fp, "\tservice_notification_period=%s\n", (temp_contact->service_notification_period == NULL) ? "" : temp_contact->service_notification_period);
 
-		fprintf(fp, "\tlast_host_notification=%lu\n", temp_contact->last_host_notification);
-		fprintf(fp, "\tlast_service_notification=%lu\n", temp_contact->last_service_notification);
+		fprintf(fp, "\tlast_host_notification=%llu\n", (long long)temp_contact->last_host_notification);
+		fprintf(fp, "\tlast_service_notification=%llu\n", (long long)temp_contact->last_service_notification);
 		fprintf(fp, "\thost_notifications_enabled=%d\n", temp_contact->host_notifications_enabled);
 		fprintf(fp, "\tservice_notifications_enabled=%d\n", temp_contact->service_notifications_enabled);
 		/* custom variables */
@@ -611,9 +611,9 @@ int xsddefault_save_status_data(void) {
 		fprintf(fp, "\tcomment_id=%lu\n", temp_comment->comment_id);
 		fprintf(fp, "\tsource=%d\n", temp_comment->source);
 		fprintf(fp, "\tpersistent=%d\n", temp_comment->persistent);
-		fprintf(fp, "\tentry_time=%lu\n", temp_comment->entry_time);
+		fprintf(fp, "\tentry_time=%llu\n", (long long)temp_comment->entry_time);
 		fprintf(fp, "\texpires=%d\n", temp_comment->expires);
-		fprintf(fp, "\texpire_time=%lu\n", temp_comment->expire_time);
+		fprintf(fp, "\texpire_time=%llu\n", (long long)temp_comment->expire_time);
 		fprintf(fp, "\tauthor=%s\n", temp_comment->author);
 		fprintf(fp, "\tcomment_data=%s\n", temp_comment->comment_data);
 		fprintf(fp, "\t}\n\n");
@@ -630,16 +630,16 @@ int xsddefault_save_status_data(void) {
 		if (temp_downtime->type == SERVICE_DOWNTIME)
 			fprintf(fp, "\tservice_description=%s\n", temp_downtime->service_description);
 		fprintf(fp, "\tdowntime_id=%lu\n", temp_downtime->downtime_id);
-		fprintf(fp, "\tentry_time=%lu\n", temp_downtime->entry_time);
-		fprintf(fp, "\tstart_time=%lu\n", temp_downtime->start_time);
-		fprintf(fp, "\tend_time=%lu\n", temp_downtime->end_time);
+		fprintf(fp, "\tentry_time=%llu\n", (long long)temp_downtime->entry_time);
+		fprintf(fp, "\tstart_time=%llu\n", (long long)temp_downtime->start_time);
+		fprintf(fp, "\tend_time=%llu\n", (long long)temp_downtime->end_time);
 		fprintf(fp, "\ttriggered_by=%lu\n", temp_downtime->triggered_by);
 		fprintf(fp, "\tfixed=%d\n", temp_downtime->fixed);
 		fprintf(fp, "\tduration=%lu\n", temp_downtime->duration);
 		fprintf(fp, "\tis_in_effect=%d\n", temp_downtime->is_in_effect);
 		fprintf(fp, "\tauthor=%s\n", temp_downtime->author);
 		fprintf(fp, "\tcomment=%s\n", temp_downtime->comment);
-		fprintf(fp, "\ttrigger_time=%lu\n", temp_downtime->trigger_time);
+		fprintf(fp, "\ttrigger_time=%llu\n", (long long)temp_downtime->trigger_time);
 		fprintf(fp, "\t}\n\n");
 	}
 
